package com.eportal.service;
import com.alibaba.fastjson.JSONObject;
import com.eportal.action.background.UserMsgAction;
import com.eportal.action.background.pojo.Page;
import com.eportal.domain.CommunityMsg;
import com.eportal.domain.Sysopt;
import com.eportal.domain.UserMsg;
import com.eportal.params.background.TCommunitymsg.TCommunityMsgParam;
import com.eportal.vo.controller.background.communitymsg.TCommunityMsgVO;
import com.framework.jqgrid.JqGridPager;
import com.framework.jqgrid.PageEntity;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

public interface UserMsgService  {

	List<Map<String, Object>> list(JqGridPager jqGridPager);

	UserMsg get(Long id);

	Map<String, Object> addMethod(String range, String receiverId, String cMsg, String abstractMsg);

	Page find(String string, Page page);

	CommunityMsg getCommunityMsg(Long sid);

	Map<String, Object> updateMethod(String sid, String range, String receiverId, String cMsg, String abstractMsg);

	Map<String, Object> deleteMethod(String sid);

	void addUserMsg(String content, String msgType, String ruserid, String suserid, String tipStatus)throws Exception;


//todo ---------------------------------------------------------------------------------------

	/**
	 * 公告通知列表
	 * @author Saber
	 * @Date 2017/8/22 下午1:28
	 * @param pageEntity		分页对象
	 * @param user				当前用户
	 * @param userRole			当前用户userRole
	 * @see UserMsgService#find(String, Page)
	 * @return
	 */
	PageInfo<TCommunityMsgVO> queryForPage(PageEntity pageEntity, Sysopt user, int userRole);

	/**
	 * 公告详情
	 * @author Saber
	 * @Date 2017/8/22 下午2:58
	 * @param sId			sId		t033_community_msg主键
	 * @param user			当前用户
	 * @param userRole		当前用户userRole
	 * @see UserMsgAction#noticeDetailView()
	 * @return
	 */
	JSONObject noticeDetail(Long sId, Sysopt user, int userRole);

	/**
	 * 保存消息
	 * @author Saber
	 * @Date 2017/8/22 下午4:01
	 * @param param			参数
	 * @param user			当前用户
	 * @param userRole		当前用户userRole
	 * @see UserMsgService#addMethod(String, String, String, String)
	 * @return
	 */
	JSONObject add(TCommunityMsgParam param, Sysopt user, int userRole);

	/**
	 * 删除消息
	 * @author Saber
	 * @Date 2017/8/22 下午6:06
	 * @param sId			sId			t033_community_msg主键
	 * @param user			当前用户
	 * @param userRole		当前用户userRole
	 * @see UserMsgService#deleteMethod(String)
	 * @return
	 */
	JSONObject delete(Long sId, Sysopt user, int userRole);
}
